import React, {lazy} from 'react'

const Demo1 = lazy(() => import('@/pages/Demo1'))
const Screen = lazy(() => import('@/pages/screen'))
const Echart = lazy(() => import('@/pages/echart'))

// 获取当前路径的前缀
const pathPrefix = window.location.pathname.split('/').slice(0, -1).join('/');

const routesArray = [
    {
        path: pathPrefix + '/demo1',
        exact: true,
        element: <Demo1/>
    },
    {
        path: pathPrefix + '/screen',
        exact: true,
        element: <Screen/>
    },
    {
        path: pathPrefix + '/echart',
        exact: true,
        element: <Echart/>
    },
    {
        path: '*',
        element: <Screen/>
    }
]

export default routesArray
